Skip to content

fix: windows terminal focus#459

Merged
Dimillian merged 4 commits intoDimillian:mainfrom
elasheraNTT:main
Feb 20, 2026
Merged

fix: windows terminal focus#459
Dimillian merged 4 commits intoDimillian:mainfrom
elasheraNTT:main

Conversation

@elasheraNTT
Copy link
Contributor

on every conversation change or some other actions the attention focussed on the terminal and it was really annoying.
Left it to focuss on user actions for terminal.

@elasheraNTT
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52a13aa6b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +368 to +372
if (!isVisible || focusRequestVersion === 0) {
return;
}
pendingFocusRef.current = true;
focusTerminalIfRequested();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Consume focus requests exactly once

This effect treats focusRequestVersion as a boolean (!= 0) instead of a monotonic request id, so once any focus request has ever happened, every later isVisible transition to true will set pendingFocusRef again and re-focus the terminal. That reintroduces unsolicited focus for non-focus open paths (for example programmatic opens that intentionally call plain openTerminal), because the old request is effectively replayed indefinitely rather than consumed once.

Useful? React with 👍 / 👎.

terminal.refresh(0, lastRow);
terminal.focus();
}, []);
focusTerminalIfRequested();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve shortcut-open focus behavior

refreshTerminal no longer focuses by default, so opening the panel now depends on an explicit requestTerminalFocus() call. The keyboard shortcut path still goes through usePanelShortcuts -> useLayoutController -> raw handleToggleTerminal (no focus request), so opening terminal via the configured shortcut leaves focus in the previous element and users cannot type until they click the terminal.

Useful? React with 👍 / 👎.

@elasheraNTT
Copy link
Contributor Author

@Dimillian codex reviewed but that focuss thing is intentional, if you are OK with that i think its good to go.

@joshhbk
Copy link
Contributor

joshhbk commented Feb 19, 2026

@Dimillian @elasheraNTT

I think a simpler solution to this could be:

image

@Dimillian Dimillian changed the title Fix/ windows terminal focus fix: windows terminal focus Feb 20, 2026
@Dimillian Dimillian merged commit 2e64bf0 into Dimillian:main Feb 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments